package org.coderk.mybatis.publisher;

import org.coderk.mybatis.event.HelloEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

/**
 * @author: TanJingyu
 * @create: 2021-04-05 15:20
 **/
@Component
public class HelloEventPublisher implements ApplicationEventPublisherAware {
    private ApplicationEventPublisher publisher;

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.publisher = applicationEventPublisher;
    }

    public void publish() {
        publisher.publishEvent(new HelloEvent("你好事件。哈哈哈。。。。。。"));
    }


}
